
echo 1 > logs/error_keeper_server.log


cd  /usr/local/openresty/nginx/

if [ -d /dev/shm/temp/ ]; then
        echo "/dev/shm/temp/ existed"
else
        mkdir /dev/shm/temp/
        chmod 777 /dev/shm/temp/
fi



p_num=`ps -ef | grep nginx | grep master | grep openresty_keeper_x | grep -v grep | wc -l`


sbin/nginx -c conf/openresty_keeper_x.conf -t


if  [ $p_num == 1  ]; then
        echo "p == 1, reload"
        sbin/nginx -c conf/openresty_keeper_x.conf -s reload

else
        echo "p not == 1, new start"
        sbin/nginx -c conf/openresty_keeper_x.conf
fi



sleep 1


ps -ef | grep nginx | grep -v iwo | grep -v cpu 

